/*
 * Copyright 2017-2101 Innel.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hykj.xxltest.service;

import com.hykj.xxltest.base.BaseService;
import com.hykj.xxltest.mapper.Class2Mapper;
import com.hykj.xxltest.model.Class2Model;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 二级分类
 *
 * @author innel
 * @email 2638086622@qq.com
 * @date 2018-06-25 14:55:52
 */
@Service
public class Class2Service extends BaseService<Class2Model, Class2Mapper> {


    public String getNameByIdList(List<Integer> ids){
        StringBuilder sb=new StringBuilder();
        for(Integer  classId:ids){
            Class2Model class2Model=getById(classId);
            sb.append(class2Model.getClassName());
            sb.append(",");
        }
        if(sb.length()>0){
            sb.deleteCharAt(sb.length()-1);
        }
        return sb.toString();

    }



}